import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import(/* webpackChunkName: "demo" */ '../views/EhomeView.vue'),
    redirect: '/EhomeView',
    children: [
      {
        //path中的内容为我们要输入浏览器的路径，或者请求服务器的路径
        path: '/GoodsShow',
        component: () => import(/* webpackChunkName: "demo" */ '../views/eui/GoodsShow.vue')
      },
      {
        path:'/GoodTypeShow',
        component:()=>import('../views/eui/GoodTypeShow.vue')
      },
      {
        path:'/SupplierShow',
        component:()=>import('../views/eui/SupplierShow.vue')
      },
      {
        path:'/BrandShow',
        component:()=>import('../views/eui/BrandShow.vue')
      },
      {
        path:'/OrderShow',
        component:()=>import('../views/eui/OrderShow.vue')
      },
      {
        path:'/CustomerShow',
        component:()=>import('../views/eui/CustomerShow.vue')
      },
      {
        path:'/GoodsShowForCustomer',
        component:()=>import('../views/eui/GoodsShowForCustomer.vue')
      },


    ]
  },

  {
    path: '/EhomeView',
    name: 'EhomeView',
    component: () => import(/* webpackChunkName: "demo" */ '../views/EhomeView.vue'),
    /*重定向使得菜单栏最开始打开的时候指向哪一个children*/
    redirect: '/GoodsShow',
  },


  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "demo" */ '../views/LoginView.vue'),
    /*重定向使得菜单栏最开始打开的时候指向哪一个children*/
  },




]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
